package pattern.State_Pattern;

import lombok.Data;

/**
 * Created by dycong on 2017/3/20.
 */
@Data
public class Content {

    protected State state;

    public Integer prize;

    public Content(){}
    public Content(Integer prize) {
        this.prize = prize;
    }

     Content init() {
        if (prize.equals(Integer.valueOf(1))) {
            state = new FirstState();
        } else if (prize.equals(Integer.valueOf(2))) {
            state = new SecondState();
        }
        return this;
    }
     void prize(){
        state.prize();
    }
}
